class Solution
{
public:
    string bestHand(vector<int> &ranks, vector<char> &suits)
    {
        bool flush = true;
        for (int i = 1; i <= 4; ++i)
        {
            if (suits[0] != suits[i])
            {
                flush = false;
                break;
            }
        }
        if (flush)
        {
            return "Flush";
        }

        unordered_map<int, int> rankCount;
        for (int rank : ranks)
        {
            ++rankCount[rank];
        }

        for (auto &[rank, count] : rankCount)
        {
            if (count >= 3)
            {
                return "Three of a Kind";
            }
        }

        for (auto &[rank, count] : rankCount)
        {
            if (count == 2)
            {
                return "Pair";
            }
        }

        return "High Card";
    }
};